<?php use_helper('jQuery')?>
<?php if($votes->count()): ?>
    <div class="votes-title span-17 last">
        <h2>Mis Votos:</h2>
    </div>
   <div class="user-votes span-17">
        <?php  foreach ($votes as $vote) : ?>
            <div class="user-vote span-10 last">
                <div class="span-3 category-image-small">
                    <img alt="<?php echo $vote->getCategory() ?>" src="<?php echo '/uploads/'.$vote->getCategory()->getThumb2() ?>"/>
                </div>
                <div class="span-7 last voted-candidate">
                    <div class="span-1">
                        <img alt="<?php echo $vote->getCandidate() ?>" src="<?php echo '/uploads/'.$vote->getCandidate()->getThumb() ?>"/>
                    </div>
                    <div class="span-6 last">
                        <h4><?php echo $vote->getCandidate() ?></h4>
                    </div>
                </div>
            </div>
        <?php endforeach; ?>
    </div>
    <div class="social-share prepend-top span-17 last">
        <div class="social-share-button span-2">
            <a href="https://twitter.com/share" class="twitter-share-button" 
               data-url="<?php echo $short_url ?>" 
               data-text="Estos son mis votos para #LoMejorDeCcs 2011" 
               data-count="none" data-via="hoyquehay" data-lang="es"
           >
                Tweet
            </a>
            <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
        </div>
        <div class="social-share-button span-2">
            <div id='fb-root'></div>
            <script src='http://connect.facebook.net/en_US/all.js'></script>
            <a href="#" onclick='postToFeed(); return false;'><img alt="Facebook Share" src="/images/fb_share_button.jpg" /></a>

            <script type="text/javascript"> 
                FB.init({appId: "<?php echo $fb_app_id ?>", status: true, cookie: true});

                function postToFeed() {
                    var obj = {
                        method: 'feed',
                        link: '<?php echo url_for('show_user_votes', $sf_user->getGuardUser(), true); ?>',
                        picture: 'http://lomejorde.hoyquehay.com.ve/images/logocompleto.png',
                        name: 'Lo Mejor de Caracas 2011',
                        caption: 'Lo Mejor de Caracas 2011: Nomina lo mejor de la ciudad en distintas categorias que representan la movida caraqueña.',
                        description: 'Estos son mis nominados a Lo Mejor de Caracas 2011.'
                    };

                    function callback(response) {
                        document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
                    }

                    FB.ui(obj, callback);
                }
            </script> 
        </div>
    </div>
<?php endif; ?>
<?php if($pending_categories->count()):?>
    <div class="pending-categories-title span-17 last">
        <h2>Aún no has votado en estas categorías:</h2>
    </div>
    <div class="pending-categories span-15 append-2 last">
        <?php foreach ($pending_categories as $key => $category) : ?>
            <div class="span-3 <?php echo ($key+1)%5 == 0 ? 'last' : ''?> category-image-small category-pending">
                <?php echo jq_link_to_remote(
                    '<img alt="'.$category->getName().'" src="/uploads/'.$category->getThumb2().'"/>',
                    array(
                        'update' => 'main-content',
                        'url'    => url_for('votaciones'),
                        'before' => 'showLoader();',
                        'complete' => 'hideLoader();',
                        'script' => true
                    ), array(
                        'class' => 'menu-option'
                    )); 
                ?>
                
            </div>
        <?php endforeach; ?>
    </div>
<?php endif; ?>